import request from "@/request";
import type {IRoleResponseData, TRoleParams} from "@/api/role/type.ts";
import type {IBaseResponseData} from "@/api/type.ts";
// 获取权限列表：/sys/role?keyword=管理员
export const getSysRoleList = (keyword:string)=>request.get<any,IRoleResponseData>("/sys/role",{
    params:{
        keyword
    }
})
//  添加权限 http://zhangpeiyue.com:8888/sys/role
export const postSysRole = (body:TRoleParams)=>request.post<any,IBaseResponseData>("/sys/role",body);
//  修改权限 http://zhangpeiyue.com:8888/sys/role
export const putSysRole = (body:TRoleParams)=>request.put<any,IBaseResponseData>("/sys/role",body);
// 分配权限http://zhangpeiyue.com:8888/sys/roledoAssign/:id
export const putSysRoleDoAssign = (id:string,body:string[])=>request.put<any,IBaseResponseData>("/sys/roledoAssign/"+id,body)